<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
<#include "/end/include/head.ftl"/>
</head>
<body>
<div>
<#--搜索框-->
    <blockquote class="layui-elem-quote">
        <form class="layui-form">
        <#--添加菜单-->
            <div class="layui-inline">
            <@shiro.hasPermission name="system.dictType.add">
                <button class="layui-btn addBtn" id="addBtn" data-url="${basePath}/dictType/toAdd.do"
                        data-title="新增类型" data-width="800px" data-height="400px">新增类型
                </button>
            </@shiro.hasPermission>
            </div>
<#--            <div class="layui-inline">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="text" name="username" id="username" placeholder="请输入用户名称" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-inline">
                <button class="layui-btn" id="userSearchBtn" lay-filter="userSearchBtn">搜索</button>
            </div>-->
        </form>
    </blockquote>
    <fieldset class="layui-elem-field">
        <legend>数据列表</legend>
        <div class="layui-collapse">
        <#list dictList as dictPage>
        <div class="layui-colla-item">
                <h2 class="layui-colla-title">
                ${dictPage.typeEntity.name}
                    <span style="padding-right:60%;float: right">${dictPage.typeEntity.description}</span>
                </h2>
                <div class="layui-colla-content">
                    <@shiro.hasPermission name="system.dictType.edit">  <a href="javascript:void(0)" class="layui-btn editBtn" data-url="${basePath}/dictType/toEdit.do?id=${dictPage.typeEntity.id}" data-title="修改用户" data-width="800px" data-height="400px">类型编辑</a></@shiro.hasPermission>
                    <@shiro.hasPermission name="system.dictType.detail">  <a class="layui-btn layui-btn-normal detailBtn" data-url="${basePath}/dictType/toDetail.do?id=${dictPage.typeEntity.id}" data-title="用户详情" data-width="800px" data-height="400px">类型详情</a></@shiro.hasPermission>
                    <@shiro.hasPermission name="system.dictType.delete">  <a class="layui-btn layui-btn-danger deleteBtn" data-url="${basePath}/dictType/doDelete.do?id=${dictPage.typeEntity.id}" data-title="删除用户" data-width="800px" data-height="400px">类型删除</a></@shiro.hasPermission>
                    <@shiro.hasPermission name="system.dictType.add">  <a class="layui-btn addBtn" data-url="${basePath}/dictData/toAdd.do" data-title="新增数据" data-width="800px" data-height="400px">数据新增</a></@shiro.hasPermission>

                    <table class="layui-table admin-table">
                        <thead>
                        <tr>
                            <th>名称</th>
                            <th>对应的值</th>
                            <th>排序，由小到大</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                         <#list dictPage.dataEntityList as info>
                            <tr>
                            <td>${info.name}</td>
                            <td>${info.value}</td>
                            <td>${info.seq}</td>
                            <td>
                                <@shiro.hasPermission name="system.dictType.edit">  <a href="javascript:void(0)" class="layui-btn layui-btn-mini editBtn" data-url="${basePath}/dictData/toEdit.do?id=${info.id}" data-title="修改数据" data-width="800px" data-height="400px">编辑</a></@shiro.hasPermission>
                                <@shiro.hasPermission name="system.dictType.detail">  <a class="layui-btn layui-btn-normal layui-btn-mini detailBtn" data-url="${basePath}/dictData/toDetail.do?id=${info.id}" data-title="数据详情" data-width="800px" data-height="400px">详情</a></@shiro.hasPermission>
                                <@shiro.hasPermission name="system.dictType.delete">  <a class="layui-btn layui-btn-danger layui-btn-mini deleteBtn" data-url="${basePath}/dictData/doDelete.do?id=${info.id}" data-title="删除数据" data-width="800px" data-height="400px">删除</a></@shiro.hasPermission>
                            </td>
                            </tr>
                         </#list>
                        </tbody>
                    </table>
                </div>
            </div>
            </#list>
        </div>
    </fieldset>

</body>
<script>
    layui.use(['element', 'layer','form'], function() {
        var form = layui.form();
        var element = layui.element();
        form.render();
        form.on('submit(userSearchBtn)', function(data){
            layer.msg(JSON.stringify(data.field));
            var page = location.search.match(/pageNo=(\d+)/);
            page = page ? page[1] : 1;
            var pageSize = $("#pageSize").val();
            var username = $("#username").val();
            location.href = '?pageSize=' + pageSize +'&pageNo='+page + '&username=' + username;
            return false;
        });
    });

</script>